/* 通用样式 */
body {
    margin: 0;
    padding: 20px;
    font-family: Arial, sans-serif;
    width: auto;
    min-width: 744px;
    min-height: 600px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 页面头部 */
.page-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 24px;
    color: #1a73e8;
    margin: 0;
}

/* 标签页 */
.tab-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    padding: 8px 15px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    position: relative;
}

.tab-button.active {
    color: #1a73e8;
    font-weight: bold;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #1a73e8;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 修改会话 编辑器 */
.container {
    display: flex;
    gap: 20px;
    position: relative;
}

.storage-list {
    width: 50px;
    transition: width 0.3s ease;
    overflow: hidden;
    position: relative;
    z-index: 10;
}

.storage-list:hover {
    width: 100px;
}

.storage-list select {
    width: 200px; /* 固定宽度，这样hover时内容不会变形 */
    height: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.editor-container.active {
    opacity: 1;
    visibility: visible;
}

/* 隐藏未选中的编辑器 */
.json-editor:not(.active),
#valueEditor:not(.active) {
    display: none;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.value-type {
    display: flex;
    gap: 15px;
}

.json-editor {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 400px;
}

#valueEditor {
    flex: 1;
    min-height: 400px;
    padding: 8px;
    font-family: monospace;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.button-container {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 拦截响应 */
.ajax-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ajax-controls {
    display: flex;
    gap: 10px;
}

.ajax-filter input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

/* 标签页列表 */
.tab-list {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tab-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
}

.tab-item:hover {
    border-color: #1a73e8;
}

.tab-item.active {
    background-color: #e8f0fe;
    border-color: #1a73e8;
}

.tab-info {
    flex: 1;
    min-width: 0;
}

.tab-title {
    font-weight: bold;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-url {
    color: #666;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 域名列表 */
.domain-list {
    margin: 10px 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.domain-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 15px;
    cursor: pointer;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
}

.domain-item:hover {
    border-color: #1a73e8;
}

.domain-item.active {
    background-color: #e8f0fe;
    border-color: #1a73e8;
}

.domain-name {
    font-size: 13px;
}

/* 请求列表 */
.request-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.request-item {
    border: 1px solid #ddd;
    border-radius: 4px;
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    background-color: #f5f5f5;
}

.request-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.request-txcode {
    font-weight: bold;
    white-space: nowrap;
}

.request-domain {
    color: #666;
    font-size: 12px;
    white-space: nowrap;
}

.request-time {
    color: #666;
    font-size: 12px;
    white-space: nowrap;
}

.request-body {
    display: none;
    padding: 10px;
}

.request-body.expanded {
    display: block;
}

.request-section {
    margin-bottom: 15px;
}

.request-section h4 {
    margin: 0 0 10px 0;
}

.request-section pre {
    margin: 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    overflow: auto;
    max-height: 400px;
}

/* 请求计数 */
.request-count {
    background-color: #1a73e8;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
    min-width: 20px;
    text-align: center;
}

/* 按钮样式 */
button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #1a73e8;
    color: white;
}

button:hover {
    background-color: #1557b0;
}

button.clear-button {
    background-color: #dc3545;
}

button.clear-button:hover {
    background-color: #bb2d3b;
}

button.export-button {
    background-color: #28a745;
}

button.export-button:hover {
    background-color: #218838;
}

.download-button {
    background-color: #28a745;
}

.download-button:hover {
    background-color: #218838;
}

/* 消息提示 */
.message {
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* 图标按钮 */
.icon-button {
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}

.icon-button:hover {
    color: #1a73e8;
}

/* Value Editor 页面 */
.editor-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
    gap: 15px;
}

.editor-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.key-info {
    color: #666;
    font-size: 14px;
}

.editor-page-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.editor-page-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

button.secondary {
    background-color: #757575;
}

button.secondary:hover {
    background-color: #616161;
}

/* 二维码标签页样式 */
.qrcode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 20px;
}

.input-container {
    width: 100%;
    max-width: 500px;
}

.qrcode-input {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    font-size: 14px;
}

.qrcode-display {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qrcode-actions {
    margin-top: 20px;
}

.qrcode-actions button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.qrcode-actions button:hover {
    background-color: #45a049;
}

/* 确保二维码图片居中显示 */
#qrcode {
    display: flex;
    justify-content: center;
    align-items: center;
}

#qrcode img {
    max-width: 100%;
    height: auto;
}

/* 二维码错误消息 */
.error-message {
    color: #dc3545;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    white-space: pre-line;
}

/* 多个二维码的样式 */
.qrcode-wrapper {
    margin-bottom: 20px;
    text-align: center;
}

.qrcode-label {
    margin-bottom: 10px;
    font-weight: bold;
    color: #666;
}

/* 调整二维码容器的样式以支持多个二维码 */
#qrcode {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    /* max-height: 400px; */
    overflow-y: auto;
    padding: 10px;
}

/* 美化滚动条 */
#qrcode::-webkit-scrollbar {
    width: 8px;
}

#qrcode::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#qrcode::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#qrcode::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 测试环境样式 */
.test-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* URL输入区域 */
.test-container textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
}

.test-container textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

/* 书签选择器 */
.test-container select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.test-container select:focus {
    outline: none;
    border-color: #1a73e8;
}

/* 锁定选项 */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-container label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

/* 参数编辑区域 */
.param-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

.param-item .label {
    min-width: 100px;
    font-weight: bold;
    color: #333;
}

.param-item input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.param-item input:focus {
    outline: none;
    border-color: #1a73e8;
}

/* 目标URL显示 */
.target-url {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    word-break: break-all;
}

.target-url a {
    color: #1a73e8;
    text-decoration: none;
    font-family: monospace;
    font-size: 14px;
}

.target-url a:hover {
    text-decoration: underline;
}

/* 书签列表 */
.bookmark-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.bookmark-item {
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.bookmark-item:hover {
    background: #e8f0fe;
}

.bookmark-name {
    font-weight: bold;
    color: #1a73e8;
}

.bookmark-value {
    color: #666;
    font-size: 12px;
    word-break: break-all;
}

/* 美化滚动条 */
.bookmark-list::-webkit-scrollbar {
    width: 8px;
}

.bookmark-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.bookmark-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.bookmark-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* URL管理样式 */
.url-manager {
    width: 100%;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.url-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.url-input-group input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.url-input-group input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.save-url-button {
    padding: 8px 15px;
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.save-url-button:hover {
    background-color: #1557b0;
}

.url-button-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.url-button-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

.url-button {
    padding: 8px 15px;
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.url-button:hover {
    background-color: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
}

.delete-url-button {
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.delete-url-button:hover {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}